#include<sys/types.h>
#include <netinet/tcp.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<iostream>
#include<string>
#include<cstring>
#include <unistd.h>
#include <cassert>
#include <stdlib.h>
using namespace std;

#define BUFFER_SIZE 64


int main(int argc,char** argv)
{
		const char* OpenNagle=argv[1];

		char read_buf[BUFFER_SIZE];
		char write_buf[BUFFER_SIZE];
		
		int ret=0;
		int port=9527;
		const char* ip="127.0.0.1";

		struct sockaddr_in address;
		bzero(&address,sizeof(address));
		address.sin_family=AF_INET;
		inet_pton(AF_INET,ip,&address.sin_addr);
		address.sin_port=htons(port);

		int socketfd=socket(PF_INET,SOCK_STREAM,0);
		assert(socketfd>=0);

        string str;
        cin>>str;
        strcpy(write_buf,str.c_str());
        connect(socketfd,(struct sockaddr*)&address,sizeof(address));
        send(socketfd,write_buf,str.size(),0);

        recv(socketfd,&read_buf,BUFFER_SIZE-1,0);
        printf("%s",read_buf);
		return 0;
}
